var http = createRequestObject();
function createRequestObject(){
    var request_;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        request_ = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else{
        request_ = new XMLHttpRequest();
    }
    return request_;
}
function getInfo(table, line_number, save, save_subtitle_id, subtitle_text, subtitle_start, subtitle_end, done){
	http.open('get', 'include/get_subtitles.php?table_id='+table+'&subtitle_id='+line_number+'&save='+save+'&save_subtitle_id='+save_subtitle_id+'&subtitle_text='+subtitle_text+'&subtitle_start='+subtitle_start+'&subtitle_end='+subtitle_end+'&done='+done);
    http.onreadystatechange = handleInfo;
    http.send(null);
}
function handleInfo(){
    if(http.readyState == 1){
        document.getElementById('subtitles_container').innerHTML = 'loading subtitles...';
    }
    if(http.readyState == 4){
        var response = http.responseText;
        document.getElementById('subtitles_container').innerHTML = response;
    }
}